package android.money;

import android.money.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MenuItem;
import android.widget.Toast;

public class Main extends Activity {
	private static final int SYNC_PAGE = Menu.FIRST;
	private static final int REPORT_PAGE = Menu.FIRST + 1;
	//private static final int OPTION_PAGE = Menu.FIRST + 2;
	private static final int ADD_PAGE = Menu.FIRST + 3;
	private static final int MANAGE_PAGE = Menu.FIRST + 4;
	
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		setContentView(R.layout.main);
				
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		menu.add(0, SYNC_PAGE,0, R.string.menu_sync).setIcon(android.R.drawable.ic_menu_send);
		menu.add(0, REPORT_PAGE,0, R.string.menu_report).setIcon(android.R.drawable.ic_menu_report_image);
		//menu.add(0, OPTION_PAGE,0, R.string.menu_option);
		menu.add(0, ADD_PAGE,0, R.string.menu_add).setIcon(android.R.drawable.ic_menu_add);	
		menu.add(0, MANAGE_PAGE,0,R.string.menu_manage).setIcon(android.R.drawable.ic_menu_manage);
		return true;
	}
    @Override
    public boolean onMenuItemSelected(int featureId, MenuItem item) {
    	super.onMenuItemSelected(featureId, item);
    	switch(item.getItemId()) {
    	case ADD_PAGE:
    		startActivity(new Intent(this, AccountAdd.class));
    		break;    	
    	case SYNC_PAGE:
    		startActivity(new Intent(this, Sync.class));
    		break;
    	case MANAGE_PAGE:
    		startActivity(new Intent(this, AccountList.class));
    		break;   
    	case REPORT_PAGE:
    		startActivity(new Intent(this, ReportOption.class));
    		break; 
    	}
    	return true;
    }	
}